package my.state.headfirst.good;

//售罄状态
public class SoldOutState implements State {

    //transient 修饰是 proxy 模式中加入的改进
    transient private GunballMachine gunballMachine;

    public SoldOutState(GunballMachine gunballMachine){
        this.gunballMachine = gunballMachine;
    }

    @Override
    public void insertQuarter() {
        System.out.println("太火爆，已经被抢光了！");
    }

    @Override
    public void ejectQuarter() {
        System.out.println("亲，已经售罄了,不能投币，当然不能退币！");
    }

    @Override
    public void turnCrank() {
        System.out.println("亲，已经售罄了,不能出糖果了！");
    }

    @Override
    public void dispense() {
        System.out.println("错误操作");
    }
}
